<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div>1111</div>
    <script>
        let arr= [1,2,3,4,5,6,5,4,3,2,1]
        let newarr =arr.filter((i,index)=>{
            return arr.indexOf(i)==index
        })
        const handleRemoveRepeat = (arr) => {
    for (let i=0,len = arr.length; i < len; i++) {
        for (let j = i + 1; j < len; j++) {
            if (arr[i] === arr[j]) {
                arr.splice(j, 1);
                j--;
                len--;
            }
        }
    }
    return arr;
};
console.log(27,handleRemoveRepeat(arr));
        // console.log(15,newarr);

        //输出 {a:6,b:3,c:3.....}
        let one = "abcabcabcaaaaewdsazmndvsa".split("")
        // console.log(18,one);
        one= one.reduce((a,b)=>{
            console.log(20,a,b); 
            if(!a[b]){
                a[b]=1
            }else{
                a[b]++
            }
            // if()
            return a
        },{})
    </script>
</body>
</html>